
/*GUI global preprocessor directive settings */
&GLOBAL-DEFINE PP_PGM_RP TRUE
&GLOBAL-DEFINE PP_ENV_GUI TRUE


/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

{mfdtitle.i "2+ "}
{cxcustom.i "rmlmrp.p"}

/* ********** Begin Translatable Strings Definitions ********* */

&SCOPED-DEFINE rmlmrp_p_7 "Slspsn[1]"
/* MaxLen: Comment: */

/* ********** End Translatable Strings Definitions ********* */

define variable nbr like lm_nbr.
define variable nbr1 like lm_nbr.
define variable code like lm_addr.
define variable code1 like lm_addr.
define variable name like ad_name.
define variable name1 like ad_name.
define variable under as character format "x(78)".
define variable bk_acct_type like csbd_type.
{&rmlmrp-P-TAG1}
define variable bk_acct_type_desc like glt_desc.

{&rmlmrp-P-TAG2}

/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
   
 RECT-FRAME       AT ROW 1.4 COLUMN 1.25
 RECT-FRAME-LABEL AT ROW 1   COLUMN 3 NO-LABEL
 SKIP(.1)  /*GUI*/
   nbr            colon 15
   nbr1           label {t001.i} colon 49 skip
   code           colon 15
   code1          label {t001.i} colon 49 skip
   name           colon 15
   name1          label {t001.i} colon 49 skip
 SKIP(.4)  /*GUI*/
with frame a side-labels          width 80 NO-BOX THREE-D /*GUI*/.

 DEFINE VARIABLE F-a-title AS CHARACTER.
 F-a-title = &IF (DEFINED(SELECTION_CRITERIA) = 0)
  &THEN " Selection Criteria "
  &ELSE {&SELECTION_CRITERIA}
  &ENDIF .
 RECT-FRAME-LABEL:SCREEN-VALUE in frame a = F-a-title.
 RECT-FRAME-LABEL:WIDTH-PIXELS in frame a =
  FONT-TABLE:GET-TEXT-WIDTH-PIXELS(
  RECT-FRAME-LABEL:SCREEN-VALUE in frame a + " ", RECT-FRAME-LABEL:FONT).
 RECT-FRAME:HEIGHT-PIXELS in frame a =
  FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.
 RECT-FRAME:WIDTH-CHARS IN FRAME a = FRAME a:WIDTH-CHARS - .5. /*GUI*/

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME


{&rmlmrp-P-TAG3}

/* SET EXTERNAL LABELS */
setFrameLabels(frame a:handle).

under = caps(dynamic-function('getTermLabelFillCentered' in h-label,
   input "CUSTOMER_ADDRESS",
   input 108,
   input "=")).

{wbrp01.i}

/*GUI*/ {mfguirpa.i true "printer" 80 " " " " " "  }

/*GUI repeat : */
/*GUI*/ procedure p-enable-ui:

   if nbr1 = hi_char then nbr1 = "".
   if code1 = hi_char then code1 = "".
   if name1 = hi_char then name1 = "".

   if c-application-mode <> 'web' then
   {&rmlmrp-P-TAG4}
   
run p-action-fields (input "display").
run p-action-fields (input "enable").
end procedure. /* p-enable-ui, replacement of Data-Entry GUI*/

/*GUI*/ procedure p-report-quote:


   {wbrp06.i &command = update &fields = "  code code1 name name1 nbr nbr1" &frm = "a"}

   {&rmlmrp-P-TAG5}
   if (c-application-mode <> 'web') or
      (c-application-mode = 'web' and
      (c-web-request begins 'data')) then do:

      bcdparm = "".
      {mfquoter.i nbr       }
      {mfquoter.i nbr1      }
      {mfquoter.i code      }
      {mfquoter.i code1     }
      {mfquoter.i name      }
      {mfquoter.i name1     }

      {&rmlmrp-P-TAG6}
      if nbr1  = "" then nbr1  = hi_char.  
      if code1 = "" then code1 = hi_char.
      if name1 = "" then name1 = hi_char.

   end.

   /* OUTPUT DESTINATION SELECTION */
   
/*GUI*/ end procedure. /* p-report-quote */
/*GUI - Field Trigger Section */

/*GUI MFSELxxx removed*/
/*GUI*/ procedure p-report:
/*GUI*/   {gpprtrpa.i "printer" 80 " " " " " " " " }
/*GUI*/   mainloop: do on error undo, return error on endkey undo, return error:




   {mfphead2.i}

   for each lm_mstr
         where (lm_nbr >= nbr and lm_nbr <= nbr1)
         and (lm_addr >= code and lm_addr <= code1)
         and (lm_surname + lm_firstname >= name and lm_surname + lm_firstname <= name1)
      no-lock by lm_nbr:

         /* DISPLAY SELECTION FORM */
         {&rmlmrp-P-TAG7}
         FORM /*GUI*/ 
            skip
                lm_nbr         colon 15        
                lm_addr        colon 66
                lm_surname     colon 15        
                lm_firstname   colon 66
                lm_gender      colon 15        
                lm_nickname    colon 66
                lm_depart      colon 15        
                lm_title       colon 66
                lm_mobile      colon 15       
                lm_mobile2     colon 66
                lm_busiphone   colon 15        
                lm_ext 
                lm_busiphone2  label "[2]" colon 66 
                lm_ext2
                lm_fax         colon 15   
                lm_fax2        label "[2]" colon 66
                lm_busiemail   colon 15  
                lm_contact     colon 15   
                lm_zip         colon 66
                lm_rmks        colon 15
         with STREAM-IO /*GUI*/  frame a1 title color normal under side-labels width 110 attr-space.
         {&rmlmrp-P-TAG8}

         /* SET EXTERNAL LABELS */
         setFrameLabels(frame a1:handle).

         FORM /*GUI*/ 
            lm_birthday      colon 15 
            lm_privemail     colon 66
            lm_homephone     colon 15  
            lm_homephone2    colon 66
            lm_msn           colon 15  
            lm_qq            colon 66
            lm_homeaddr      colon 15  
            lm_homezip       colon 66
            lm_society1      colon 15  
            lm_society2      colon 15  
            lm_society3      colon 15  
         with STREAM-IO /*GUI*/  frame b title color normal (getFrameTitle("PRECUSTOMER_DATA",20)) side-labels width 110 attr-space.

         /* SET EXTERNAL LABELS */
         setFrameLabels(frame b:handle).

         {&rmlmrp-P-TAG9}
         display 
            lm_nbr         
            lm_addr        
            lm_surname     
            lm_firstname   
            lm_gender      
            lm_nickname    
            lm_depart      
            lm_title       
            lm_mobile      
            lm_mobile2     
            lm_busiphone   
            lm_ext 
            lm_busiphone2  
            lm_ext2
            lm_fax         
            lm_fax2        
            lm_busiemail   
            lm_contact     
            lm_zip         
            lm_rmks        
             with frame a1 STREAM-IO /*GUI*/ .

         display 
            lm_birthday    
            lm_privemail   
            lm_homephone   
            lm_homephone2  
            lm_msn         
            lm_qq          
            lm_homeaddr    
            lm_homezip     
            lm_society1    
            lm_society2    
            lm_society3    
         with frame b STREAM-IO /*GUI*/ .

         {&rmlmrp-P-TAG10}
         
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/

   end. /* for each lm_mstr */
   
   
   /* REPORT TRAILER  */

   
/*GUI*/ {mfguitrl.i} /*Replace mfrtrail*/

/*GUI*/ {mfgrptrm.i} /*Report-to-Window*/


end. /* repeat: */

{wbrp04.i &frame-spec = a}

/*GUI*/ end procedure. /*p-report*/
/*GUI*/ {mfguirpb.i &flds=" nbr nbr1 code code1 name name1 "} /*Drive the Report*/

